import { Suspense, memo } from "react";
import { useRoutes } from "react-router-dom";
import routes from "./router";
import Header from "./components/Header";
import Footer from "./components/Footer";
import useScrollTop from "./hooks/useScrollTop";

const App = memo(() => {
  useScrollTop();

  return (
    <div className="app">
      <Header></Header>
      {/* <Suspense fallback="loading"> */}
      <div className="page">{useRoutes(routes)}</div>
      {/* </Suspense> */}
      <Footer></Footer>
    </div>
  );
});

export default App;
